﻿
<cfscript>
    Badge = CreateObject("component", "Badges").init();
    Badges = Badge.getBadgePicList();
    BadgeThumbs = Badge.getBadgeThumbList();
</cfscript>

<cfset badge_struct = {} />
<cfset badge_thumbs_struct = {} />

<cfloop query="Badges" >
    <cfoutput>
        <cfset badge_struct[Name] = Name />
    </cfoutput>
</cfloop>

<cfloop query="BadgeThumbs" >
    <cfoutput>
        <cfset badge_thumbs_struct[Name] = Name />
    </cfoutput>
</cfloop>


<cfloop collection="#badge_struct#" item="b">
    <cfif !StructKeyExists(badge_thumbs_struct, b) >
        <cfset Badge.makeBadgeThumb(b) />
        Created thumb for <cfoutput>#b#</cfoutput><br />
    </cfif>    
</cfloop>

Done!